import request from '@/utils/request'


export function FinalNode(data) {
    return request({
      url: '/ny-iqc/handled/FinalNode',
      method: 'post',
      data
    })
}
export function getPreviousTaskFlowElement(query) {
    return request({
      url: '/activiti/process/getPreviousTaskFlowElement',
      method: 'get',
      params: query
    })
}
export function flowDisposeCheck(query) {
    return request({
        url: '/ny-iqc/handled/flowDisposeCheck',
        method: 'get',
        params: query
    })
}
export function getProcessById(query) {
    return request({
      url: '/ny-iqc/handled/list',
      method: 'get',
      params: query
    })
}
export function getNodeListByAppNameProcKey(query) {
    return request({
      url: '/activiti/processBusiness/getNodeListByAppNameProcKey',
      method: 'get',
      params: query
    })
}
// 查询列表
export function listNcrReview(query) {
    return request({
      url: '/ny-iqc/ncrReview/list',
      method: 'get',
      params: query
    })
}

export function initiateCheck(query) {
    return request({
      url: '/ny-iqc/handled/initiateCheck',
      method: 'get',
      params: query
    })
}
// 查询详情
export function getNcrReviewDetail(id) {
    return request({
      url: '/ny-iqc/ncrReview/'+id,
      method: 'get',
    })
}


export function getRectificationList(id) {
    return request({
      url: '/ny-iqc/rectification/list/'+id,
      method: 'get',
    })
}

export function getRectificationDetail(id) {
    return request({
      url: '/ny-iqc/rectification/detail/'+id,
      method: 'get',
    })
}

export function flowDispose(data) {
    return request({
      url: '/ny-iqc/handled/flowDispose',
      method: 'post',
      data
    })
}

export function submitMRB(data) {
    return request({
      url: '/ny-iqc/handled/initiate',
      method: 'post',
      data
    })
}

export function pushRectification(data) {
    return request({
      url: '/ny-iqc/rectification/push',
      method: 'post',
      data
    })
}

export function saveRectification(data) {
    return request({
      url: '/ny-iqc/rectification/save',
      method: 'post',
      data
    })
}

export function getRefInfo(id) {
    return request({
      url: `/ny-iqc/rectification/getInfo/${id}`,
      method: 'get'
    })
}

export function getRefTimeByType(reportType) {
    return request({
      url: `/ny-iqc/rectification/getTime/${reportType}`,
      method: 'get'
    })
}

export function setNoSend(id) {
    return request({
      url: `/ny-iqc/rectification/noSend/${id}`,
      method: 'post'
    })
}

export function rectificationTem(params) {
    return request({
        url: '/ny-iqc/rectificationTem/pageList',
        method: 'get',
        params
    })
}
export function rectificationFun(params) {
    return request({
        url: '/ny-iqc/rectificationFun/pageList',
        method: 'get',
        params
    })
}
export function rectificationCorrect(params) {
    return request({
        url: '/ny-iqc/rectificationCorrect/pageList',
        method: 'get',
        params
    })
}
export function rectificationShort(params) {
    return request({
        url: '/ny-iqc/rectificationShort/pageList',
        method: 'get',
        params
    })
}

// MRB审核
export function getApproval(data) {
  return request({
    url: '/ny-iqc/handled/approveMRBForm',
    method: 'post',
    data
  })
}

// 提交MRB表单
export function ncrReviewList(data) {
  return request({
    url: '/ny-iqc/handled/saveOrUpdateMRBForm',
    method: 'post',
    data
  })
}

// 发起Mrb- 暂存
export function getMrbTs(data){
  return request({
    url: "/ny-iqc/handled/mrbFormTs",
    method: "post",
    data,
  });
}